Release 10.1A: OpenEdge Development:
ADM Reference
destroyObject
Procedure that cleans up and deletes the current object procedure and its descendents, if any.
Location: smart.p Parameters: None Notes:
- Checks first to see if any object is not prepared to be destroyed (for example, if DataModified is set). This is done by publishing the named event confirmExit, which is implemented for example in
datavis.pfor visual data objects which can return FALSE if their DataModified property is set, indicating that they have unsaved changes to the current record. Because of this possible error return, application code that runs destroyObject should check ERROR–STATUS:ERROR to see whether the operation succeeded or not.- The destroyObject procedure runs removeAllLinks to delete all SmartLinks associated with this object.
- The standard ADM construct for a SmartWindow is to have the CLOSE trigger run destroyObject. Therefore, the statements APPLY CLOSE to hSmartWin and RUN destroyObject IN hSmartWin normally have equivalent results. You should use APPLY CLOSE so as to catch any other effects of this event. For other SmartObjects,
RUN destroyObjectis the recommended way to destroy the object.- All SmartContainers PUBLISH destroyObject to delete all the SmartObject procedures they contain, before destroying themselves.
- You can localize the destroyObject procedure to add a check to do cleanup before a destroy completes, or to stop a destroy event from finishing. (See the "confirmExit" section entry for the standard event procedure for doing this.)
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |